package week06.day02;

import java.util.Scanner;

public class 上机练习 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入三位数，例如“153”：");
        int num = scanner.nextInt();
        int a = num/100;//提取百位数
        int b = num/10%10;//提取十位数
        int c = num%10;//提取个位数
        if (num==(a*a*a)+(b*b*b)+(c*c*c)){//计算输入数值是否符合水仙数要求
            System.out.println(num+"为水仙数");
        }else {
            System.out.println(num+"不是水仙数");
        }
    }
}
